﻿using System;
using System.Windows;

namespace ThePresenter.Windows
{
	/// <summary>
	/// Interaction logic for InputNameBox.xaml
	/// </summary>
	public partial class InputNameBox : Window
	{
		public String Username
		{
			get
			{
				return this.usernameTextBox.Text;
			}
			set
			{
				this.usernameTextBox.Text = value;
			}
		}

		public InputNameBox()
		{
			InitializeComponent();
		}

		void okButton_Click(object sender, RoutedEventArgs e)
		{
			// Don't accept the dialog box if there is invalid data
			if (this.usernameTextBox.Text == String.Empty) {
				MessageBox.Show(Properties.Resources.Username_EmptyError, "", MessageBoxButton.OK, MessageBoxImage.Exclamation);
				return;
			}

			// Dialog box accepted
			this.DialogResult = true;
		}
	}
}